package com.l.web.service.webcontent;

import com.l.web.service.ServiceSupport;
import com.l.web.service.system.webnode.WebNode;
import com.l.web.service.system.webnode.WebNodeDAO;
import org.l.qiao.search.Field;
import org.l.qiao.search.Sort;

import java.util.List;

public class WebContentService extends ServiceSupport {

    private WebNodeDAO webNodeDAO;

    public void setWebNodeDAO(WebNodeDAO webNodeDAO) {
        this.webNodeDAO = webNodeDAO;
    }

    public String execute()
    {
        Field field = new Field();
        field.include(WebNode.NAME, WebNode.PARENT_ID, WebNode.CREATED, WebNode.TYPE);
        Sort sort = new Sort();
        sort.asc(WebNode.INDEX);
        List webNodes = webNodeDAO.find(null, field, sort);
        context.put("webNodes", webNodes);
        return SUCCESS;
    }
}
